import request from '@/config/axios'

export interface DocGroupVO {
        id: number
        name: string
        sceneCode: string
        sort: number
}

// 查询知识库列表
export const getDocGroupPage = async (params) => {
    return await request.get({url: `/system/doc-group/page`, params})
}

// 查询知识库详情
export const getDocGroup = async (id: number) => {
    return await request.get({url: `/system/doc-group/get?id=` + id})
}

// 新增知识库
export const createDocGroup = async (data: DocGroupVO) => {
    return await request.post({url: `/system/doc-group/create`, data})
}

// 修改知识库
export const updateDocGroup = async (data: DocGroupVO) => {
    return await request.put({url: `/system/doc-group/update`, data})
}

// 删除知识库
export const deleteDocGroup = async (id: number) => {
    return await request.delete({url: `/system/doc-group/delete?id=` + id})
}

// 导出知识库 Excel
export const exportDocGroup = async (params) => {
    return await request.download({url: `/system/doc-group/export-excel`, params})
}